<template>
  <div class="stu">
    <el-container class="layout">
      <!-- 头部组件 -->
      <el-header class="header">
        <MainHeader />
      </el-header>

      <el-container class="content">
        <!-- 侧边栏组件 -->
        <el-aside width="200px" class="sidebar">
          <MainMenu />
        </el-aside>

        <!-- 右侧内容区域 -->
        <el-container class="main">
          <!-- 面包屑 -->
          <el-header class="breadcrumb">
            <BreadCrumb />
          </el-header>

          <!-- 主内容 -->
          <el-main>
            <div class="student-home">
              <h1>学生主页</h1>
              <router-view></router-view>
            </div>
          </el-main>

          <!-- 底部 -->
          <el-footer class="footer">
            <MainFooter />
          </el-footer>
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>





<script>
import MainHeader from '@/components/common/Header.vue'
import MainFooter from '@/components/common/Footer.vue'
import BreadCrumb from '@/components/common/Bread.vue'
import MainMenu from '@/components/common/Menu.vue'

export default {
  name: 'StudentHome',
  components: {
    MainHeader,
    MainFooter,
    BreadCrumb,
    MainMenu
  }
}
</script>

<style scoped>
/* 最外层撑满 */
.layout {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 头部固定 */
.header {
  height: 60px;
  padding: 0;
}

/* 内容区 = 侧边栏 + 主内容 */
.content {
  flex: 1;
  display: flex;
  min-height: 0; /* 关键：避免子元素塌陷 */
}

/* 侧边栏始终等高 */
.sidebar {
  background: #2578b5;
  color: #fff;
  height: 100%;
  overflow-y: auto;
}

/* 主内容区 */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 面包屑 */
.breadcrumb {
  padding: 10px;
  height: auto;
  background: #fff;
}

/* 主体 */
.el-main {
  flex: 1;
  background-color: #f5f7fa;
  padding: 20px;
  overflow-y: auto;
}

/* 底部 */
.footer {
  height: 50px;
  background: #f0f0f0;
  text-align: center;
  line-height: 50px;
}
</style>
